kill (bash built-in)
from kill(1)
kill (bash built-in)
code:plain
Send the processes identified by PID or JOBSPEC the signal named by
SIGSPEC or SIGNUM. If neither SIGSPEC nor SIGNUM is present, then
SIGTERM is assumed.
kill 0は、プロセスグループに対して任意のシグナルを送信する
デフォルトではSIGTERM
現在のシェルでkill 0を実行したら終了してしまいそうだけど、そうではない
対話シェル && trapが無ければSIGTERMは無視する
When Bash is interactive, in the absence of any traps, it ignores SIGTERM (so that ‘kill 0’ does not kill an interactive shell), and SIGINT is caught and handled (so that the wait builtin is interruptible).
https://www.gnu.org/software/bash/manual/bash.html#Signals
kill -KILL 0したら終了した
Bashのジョブをkill -STOP と kill -CONT で一時停止・再開することもできる